package com.liu.demo6.Mapper;

import com.liu.demo6.entity.Student;
import org.apache.ibatis.annotations.*;

@Mapper
public interface StudentMapper {
        // 根据id查询学生信息（已存在的查询方法）
        @Select("select * from student where id = #{id}")
        Student findById(int id);

        // 插入学生信息的方法
        @Insert("insert into student (name, qq) values (#{name}, #{qq})")
        int insertStudent(Student student);

        // 根据id更新学生信息的方法
        @Update("update student set name = #{name}, qq = #{qq} where id = #{id}")
        int updateStudent(Student student);

        // 根据id删除学生信息的方法
        @Delete("delete from student where id = #{id}")
        int deleteStudent(int id);
    }
